CC = g++
CCFLAGS = -g 

FLEX = flex
FLEX_OPTS = -Poql7

BISON = bison
BISON_OPTS = -t -poql7 --verbose

all: testoql 

.PHONY: clean distclean

clean:
	rm -f *.o testoql

allclean: clean
	rm -f *.o Parser.c Lexer.c testoql 

testoql: Absyn.o Lexer.o Parser.o Test.o Ast.o Symtab.o BaseMining.o Testflow.o
	@echo "Linking testoql..."
	${CC} ${CCFLAGS} *.o -o testoql

Absyn.o: Absyn.c Absyn.h
	${CC} ${CCFLAGS} -c Absyn.c

Lexer.o: Lexer.c Parser.h
	${CC} ${CCFLAGS} -c Lexer.c 

Parser.o: Parser.c Absyn.h
	${CC} ${CCFLAGS} -c Parser.c

Ast.o: Ast.c Ast.h Absyn.h Symtab.h BaseMining.h
	${CC} ${CCFLAGS} -c Ast.c
	
Test.o: Test.c Parser.h  Absyn.h Ast.h
	${CC} ${CCFLAGS} -c Test.c

Testflow.o: TestflowMining.cpp TestflowMining.h Symtab.h MiningWrapper.h MacString.h
	${CC} ${CCFLAGS} -c TestflowMining.cpp

BaseMining.o: BaseMining.cpp BaseMining.h TestflowMining.h
	${CC} ${CCFLAGS} -c BaseMining.cpp

Expr.o: MiningWrapper.h
	${CC} ${CCFLAGS} -c Expr.c



